<style>
.fui-header a.back:before {
    border-color: #fff;
}
.fui-list .fui-list-inner .subtitle {
    font-size: .6rem;
    color: #999;
}
input[type=checkbox], input[type=radio] {
    margin-right: 0.3rem;
}
</style>
<div class="fui-page fui-page-current page-commission-down">
	<div class="fui-header sysbgcolor">
        <div class="fui-header-left">
            <a class="back" style="color:#fff" ng-click="goback();"></a>
        </div>
        <div class="title" style="color:#fff">本商户会员</div>
    </div>
    <div class="fui-content">
		<div style="padding:0.5rem;margin-top:-0.5rem">
		<div class="tips tips-yellow" style="margin: 0.2rem 0;">
			<i class="fa fa-bullhorn"></i>
			[<red>温馨提示</red>]：
			</br>1、每个商户有自己的会员体系（具体如何成为商户的会员，请移步基本设置--商户会员体系）；！
			</br>2、需管理员平台设置好消息模板ID（移步：多商户总部后台--设置--基本设置--消息模板设置），才能有消息提醒！
		</div>
        <div class="fui-list-group radius" id="container" >
		<div ng-repeat="item in pagedata.list" class="fui-list" style="height:auto;align-items:initial">
			<div class="fui-list-media" style="align-items:initial">
				<img ng-src="{{tomedia(item.member.avatar) ||'../core/resource/images/nopic.jpg'}}" class="round" style="width:3rem;height:3rem">
			</div>
			<div class="fui-list-inner">
				<div class="row">
				    <div class="row-text">
					 {{item.member.nickname}}(ID{{item.mid}}) <span ng-click="pagedata.showedit=true;pagedata.post=item" class='fui-label fui-label-danger' style="font-size:0.6rem"><i class="icon icon-bianji" style="font-size:0.6rem"></i> 编辑</span>
				    </div>
				</div>
				<div class="subtitle">
					 上级:{{item.shmember.nickname}}(ID{{item.fromuser}})
				</div>
				<div class="subtitle">
				    {{item.leveltitle}}
				</div>
				<div class="gray" style="font-size:0.6rem">
				    <span style="text-align:left" ng-repeat="i in item.creditdata">
					{{i.title}} <span style="color:red">{{i.value}}</span>
					</span>
				</div>
				<div class="subtitle">
				    来源: {{item.from_os}}
				</div>
				<div class="subtitle">
				    注册时间:{{item.createtime}}
				</div>
				<div class="subtitle">
				    <span ng-click="pagedata.showsendcoupon=true;pagedata.post.mid=item.mid" class='fui-label fui-label-default'>发优惠券</span>
					<span ng-click="pagedata.showsendmsg=true;pagedata.post.mid=item.mid" class='fui-label fui-label-success'>发消息</span>
					<span ng-click="pagedata.showrecharge=true;pagedata.post.mid=item.mid" class='fui-label fui-label-primary'>充值</span>
					<span ng-click="pagedata.showchange=true;pagedata.post.mid=item.mid;pagedata.post.fromuser=item.fromuser" class='fui-label fui-label-warning'>修改推荐人</span>
				</div>
			</div>
		</div>
		</div>
		<div class='infinite-loading' style="display:none" id="loading_show"><span class='fui-preloader'></span><span class='text'> 正在加载...</span></div>
		<div ng-if="pagedata.list.length==0" class='content-empty' >
			<i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i>
			<br/>
			<p style="color: #999;font-size: .75rem">暂时没有任何数据</p>
		</div>
		</div>
    </div>
</div>
<div ng-if="pagedata.showsendcoupon" class="popup">
	<div class="popup-body">
		<div class="popup-bottom">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showsendcoupon=false"></i>
			<div class="fui-cell-title bold">发优惠券</div>
			<div class="fui-cell-group">
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:auto">选择优惠券</div>
					<div class="fui-cell-text">
						<select class="selectpicker weui_select" data-live-search="true" style="padding:0.3rem" ng-model="pagedata.post.coupon">
							<option ng-repeat="item in pagedata.coupons" ng-select="pagedata.post.coupon==item.id" value="{{item.id}}">{{item.title}}</option>
						</select>
					</div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:auto">发放数量</div>
					<div class="fui-cell-text">
						<input type="text" class="fui-input" placeholder="发放数量" ng-model="pagedata.post.num"/>
					</div>
				</div>
			</div>
			<div style="padding:0 1rem">
			  <a href="javascript:;" ng-click="post(pagedata.post,'/manage.member/sendcoupon/')"  class="weui_btn weui_btn_primary" style="border-radius:1rem;line-height: 3;margin-top:1.5rem">确认提交</a>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.showsendmsg" class="popup">
	<div class="popup-body">
		<div class="popup-bottom">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showsendmsg=false"></i>
			<div class="fui-cell-title bold">发消息</div>
			<div class="fui-cell-group">
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:auto">消息内容</div>
					<div class="fui-cell-text">
						<textarea rows="2" placeholder="200字内消息内容" ng-model="pagedata.post.content"></textarea>
					</div>
				</div>
			</div>
			<div style="padding:0 1rem">
			  <a href="javascript:;" ng-click="post(pagedata.post,'/manage.member/sendmsg/')"  class="weui_btn weui_btn_primary" style="border-radius:1rem;line-height: 3;margin-top:1.5rem">确认提交</a>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.showrecharge" class="popup">
	<div class="popup-body">
		<div class="popup-bottom">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showrecharge=false"></i>
			<div class="fui-cell-title bold">充值</div>
			<div class="fui-cell-group">
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:auto">币类型</div>
					<div class="fui-cell-text">
						<div ng-repeat="(key,item) in pagedata.credit_types" class="fui-cell-label" style="margin-right:0.8rem;float:left;margin-bottom:0.2rem">
							<input type="radio" class="fui fui-radio fui-radio-danger verify-radio" name="radio2" ng-model="pagedata.post.type" value="{{key}}">{{item}}
						</div>
					</div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:auto">增加/减少</div>
					<div class="fui-cell-text">
						<div class="fui-cell-label" style="margin-right:0.8rem;float:left;margin-bottom:0.2rem">
							<input type="radio" class="fui fui-radio fui-radio-danger verify-radio" name="radio3" ng-model="pagedata.post.is_add" value="0">减少
						</div>
						<div class="fui-cell-label" style="margin-right:0.8rem;float:left;margin-bottom:0.2rem">
							<input type="radio" class="fui fui-radio fui-radio-danger verify-radio" name="radio3" ng-model="pagedata.post.is_add" value="1">增加
						</div>
					</div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:auto">额度</div>
					<div class="fui-cell-text">
						<input type="text" class="fui-input" ng-model="pagedata.post.value"/>
					</div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:auto">备注</div>
					<div class="fui-cell-text">
						<input type="text" class="fui-input" ng-model="pagedata.post.remark"/>
					</div>
				</div>
			</div>
			<div style="padding:0 1rem">
			  <a href="javascript:;" ng-click="post(pagedata.post,'/manage.member/recharge/')"  class="weui_btn weui_btn_primary" style="border-radius:1rem;line-height: 3;margin-top:1.5rem">确认提交</a>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.showchange" class="popup">
	<div class="popup-body">
		<div class="popup-bottom">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showchange=false"></i>
			<div class="fui-cell-title bold">修改推荐人</div>
			<div class="fui-cell-group">
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:auto">推荐人ID</div>
					<div class="fui-cell-text">
						<input type="text" class="fui-input" placeholder="推荐人ID" ng-model="pagedata.post.fromuser"/>
					</div>
				</div>
			</div>
			<div style="padding:0 1rem">
			  <a href="javascript:;" ng-click="post(pagedata.post,'/manage.member/change/')"  class="weui_btn weui_btn_primary" style="border-radius:1rem;line-height: 3;margin-top:1.5rem">确认提交</a>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.showedit" class="popup">
	<div class="popup-body">
		<div class="popup-bottom">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showedit=false"></i>
			<div class="fui-cell-title bold">编辑</div>
			<div class="fui-cell-group">	
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:auto">会员昵称</div>
					<div class="fui-cell-text">
						<input type="text" class="fui-input" ng-model="pagedata.post.nickname"/>
					</div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:auto">会员等级</div>
					<div class="fui-cell-text">
						<select class="selectpicker weui_select" data-live-search="true" style="padding:0.3rem" ng-model="pagedata.post.level">
							<option ng-repeat="item in pagedata.levels" ng-select="pagedata.post.level==item.id" value="{{item.id}}">{{item.title}}</option>
						</select>
					</div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:auto">真实姓名</div>
					<div class="fui-cell-text">
						<input type="text" class="fui-input" ng-model="pagedata.post.realname"/>
					</div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:auto">手机号</div>
					<div class="fui-cell-text">
						<input type="text" class="fui-input" ng-model="pagedata.post.mobile"/>
					</div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:auto">加入黑名单</div>
					<div class="fui-cell-text">
						<div class="fui-cell-label" style="margin-right:0.8rem;float:left;margin-bottom:0.2rem">
							<input type="radio" class="fui fui-radio fui-radio-danger verify-radio" name="radio3" ng-model="pagedata.post.isblack" value="0">否
						</div>
						<div class="fui-cell-label" style="margin-right:0.8rem;float:left;margin-bottom:0.2rem">
							<input type="radio" class="fui fui-radio fui-radio-danger verify-radio" name="radio3" ng-model="pagedata.post.isblack" value="1">是
						</div>
					</div>
				</div>
			</div>
			<div style="padding:0 1rem">
			  <a href="javascript:;" ng-click="post(pagedata.post,'/manage.member/post/')"  class="weui_btn weui_btn_primary" style="border-radius:1rem;line-height: 3;margin-top:1.5rem">确认提交</a>
			</div>
		</div>
	</div>
</div>
<script>
scope.tool.get_list('jy_merch/manage.member/list/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_merch/manage.member/list/');
}
</script>

